home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / Programming / MPW Interfaces & Libraries 3.1 / CIncludes / Controls.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-10-13  |  5.1 KB  |  181 lines  |  [TEXT/MPS ]

  1. /************************************************************
  2.  
  3. Created: Thursday, September 7, 1989 at 3:25 PM
  4.     Controls.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.     Copyright Apple Computer, Inc. 1985-1989
  9.     All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __CONTROLS__
  15. #define __CONTROLS__
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <Quickdraw.h>
  19. #endif
  20.  
  21. #define pushButProc 0
  22. #define checkBoxProc 1
  23. #define radioButProc 2
  24. #define useWFont 8
  25. #define scrollBarProc 16
  26. #define inButton 10
  27. #define inCheckBox 11
  28. #define inUpButton 20
  29. #define inDownButton 21
  30. #define inPageUp 22
  31. #define inPageDown 23
  32. #define inThumb 129
  33.  
  34. /*
  35. axis constraints for DragGrayRgn call */
  36.  
  37. #define noConstraint 0
  38. #define hAxisOnly 1
  39. #define vAxisOnly 2
  40.  
  41. /*
  42. control messages */
  43.  
  44. #define drawCntl 0
  45. #define testCntl 1
  46. #define calcCRgns 2
  47. #define initCntl 3
  48. #define dispCntl 4
  49. #define posCntl 5
  50. #define thumbCntl 6
  51. #define dragCntl 7
  52. #define autoTrack 8
  53. #define cFrameColor 0
  54. #define cBodyColor 1
  55. #define cTextColor 2
  56. #define cThumbColor 3
  57.  
  58. struct ControlRecord {
  59.     struct ControlRecord **nextControl;
  60.     WindowPtr contrlOwner;
  61.     Rect contrlRect;
  62.     unsigned char contrlVis;
  63.     unsigned char contrlHilite;
  64.     short contrlValue;
  65.     short contrlMin;
  66.     short contrlMax;
  67.     Handle contrlDefProc;
  68.     Handle contrlData;
  69.     ProcPtr contrlAction;
  70.     long contrlRfCon;
  71.     Str255 contrlTitle;
  72. };
  73.  
  74. typedef struct ControlRecord ControlRecord;
  75. typedef ControlRecord *ControlPtr, **ControlHandle;
  76.  
  77. struct CtlCTab {
  78.     long ccSeed;            /*reserved*/
  79.     short ccRider;            /*see what you have done - reserved*/
  80.     short ctSize;            /*usually 3 for controls*/
  81.     ColorSpec ctTable[4];
  82. };
  83.  
  84. typedef struct CtlCTab CtlCTab;
  85. typedef CtlCTab *CCTabPtr, **CCTabHandle;
  86.  
  87. struct AuxCtlRec {
  88.     Handle acNext;            /*handle to next AuxCtlRec*/
  89.     ControlHandle acOwner;    /*handle for aux record's control*/
  90.     CCTabHandle acCTable;    /*color table for this control*/
  91.     short acFlags;            /*misc flag byte*/
  92.     long acReserved;        /*reserved for use by Apple*/
  93.     long acRefCon;            /*for use by application*/
  94. };
  95.  
  96. typedef struct AuxCtlRec AuxCtlRec;
  97. typedef AuxCtlRec *AuxCtlPtr, **AuxCtlHandle;
  98.  
  99. #ifdef __cplusplus
  100. extern "C" {
  101. #endif
  102. pascal ControlHandle NewControl(WindowPtr theWindow,const Rect *boundsRect,
  103.     const Str255 title,Boolean visible,short value,short min,short max,short procID,
  104.     long refCon)
  105.     = 0xA954;
  106. pascal void SetCTitle(ControlHandle theControl,const Str255 title)
  107.     = 0xA95F;
  108. pascal void GetCTitle(ControlHandle theControl,Str255 title)
  109.     = 0xA95E;
  110. pascal ControlHandle GetNewControl(short controlID,WindowPtr owner)
  111.     = 0xA9BE;
  112. pascal void DisposeControl(ControlHandle theControl)
  113.     = 0xA955;
  114. pascal void KillControls(WindowPtr theWindow)
  115.     = 0xA956;
  116. pascal void HideControl(ControlHandle theControl)
  117.     = 0xA958;
  118. pascal void ShowControl(ControlHandle theControl)
  119.     = 0xA957;
  120. pascal void DrawControls(WindowPtr theWindow)
  121.     = 0xA969;
  122. pascal void Draw1Control(ControlHandle theControl)
  123.     = 0xA96D;
  124. pascal void HiliteControl(ControlHandle theControl,short hiliteState)
  125.     = 0xA95D;
  126. pascal void UpdtControl(WindowPtr theWindow,RgnHandle updateRgn)
  127.     = 0xA953;
  128. pascal void MoveControl(ControlHandle theControl,short h,short v)
  129.     = 0xA959;
  130. pascal void SizeControl(ControlHandle theControl,short w,short h)
  131.     = 0xA95C;
  132. pascal void SetCtlValue(ControlHandle theControl,short theValue)
  133.     = 0xA963;
  134. pascal short GetCtlValue(ControlHandle theControl)
  135.     = 0xA960;
  136. pascal void SetCtlMin(ControlHandle theControl,short minValue)
  137.     = 0xA964;
  138. pascal short GetCtlMin(ControlHandle theControl)
  139.     = 0xA961;
  140. pascal void SetCtlMax(ControlHandle theControl,short maxValue)
  141.     = 0xA965;
  142. pascal short GetCtlMax(ControlHandle theControl)
  143.     = 0xA962;
  144. pascal void SetCRefCon(ControlHandle theControl,long data)
  145.     = 0xA95B;
  146. pascal long GetCRefCon(ControlHandle theControl)
  147.     = 0xA95A;
  148. pascal void SetCtlAction(ControlHandle theControl,ProcPtr actionProc)
  149.     = 0xA96B;
  150. pascal ProcPtr GetCtlAction(ControlHandle theControl)
  151.     = 0xA96A;
  152. pascal void DragControl(ControlHandle theControl,Point startPt,const Rect *limitRect,
  153.     const Rect *slopRect,short axis)
  154.     = 0xA967;
  155. pascal short TestControl(ControlHandle theControl,Point thePt)
  156.     = 0xA966;
  157. pascal short TrackControl(ControlHandle theControl,Point thePoint,ProcPtr actionProc)
  158.     = 0xA968;
  159. pascal short FindControl(Point thePoint,WindowPtr theWindow,ControlHandle *theControl)
  160.     = 0xA96C;
  161. pascal void SetCtlColor(ControlHandle theControl,CCTabHandle newColorTable)
  162.     = 0xAA43;
  163. pascal Boolean GetAuxCtl(ControlHandle theControl,AuxCtlHandle *acHndl)
  164.     = 0xAA44;
  165. pascal short GetCVariant(ControlHandle theControl)
  166.     = 0xA809;
  167. void dragcontrol(ControlHandle theControl,Point *startPt,const Rect *limitRect,
  168.     const Rect *slopRect,short axis);
  169. ControlHandle newcontrol(WindowPtr theWindow,const Rect *boundsRect,char *title,
  170.     Boolean visible,short value,short min,short max,short procID,long refCon);
  171. short findcontrol(Point *thePoint,WindowPtr theWindow,ControlHandle *theControl);
  172. void getctitle(ControlHandle theControl,char *title);
  173. void setctitle(ControlHandle theControl,char *title);
  174. short trackcontrol(ControlHandle theControl,Point *thePoint,ProcPtr actionProc);
  175. short testcontrol(ControlHandle theControl,Point *thePt);
  176. #ifdef __cplusplus
  177. }
  178. #endif
  179.  
  180. #endif
  181.